package BlogMybatis.blog.mapper;

import BlogMybatis.blog.pojo.Blog;

import BlogMybatis.blog.pojo.BlogAndTags;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author Brandt
 * @since 2020-06-07
 */
public interface BlogMapper extends BaseMapper<Blog> {

    List<Blog> getAllBlog();

    List<Blog> searchAllBlog(Blog blog);

    Blog getByBlog( Long id);

    int updateBlog(Blog blog);

    //保存blog id,tag id数据到blog_tags表中
    int saveBlogAndTag(BlogAndTags blogAndTags);

    List<Blog> getIndexBlog();

    List<Blog> getAllRecommendBlog();

    Blog getDetailedBlog(Long id);

    int updateViews(Long id);

    List<Blog> getSearchBlog(String query);

    List<Blog>listBlogFooter();

    List<Blog> getByTypeId(Long typeId);

    List<Blog> getByTagId(Long tagId);

    List<Blog> archiveShow();
}
